<template>
	<view>
		<view class="menu_box">
			<view class="title">
				你的菜谱收藏列表有点空
			</view>
			<view class="container"  v-if="data">
				<view class="menu_container" v-for="item,index in data">
					<block >
						<view class="con_left">
							<image class="left_img" @tap="menuClick(item)" :src="`${item.image_u}`" mode="scaleToFill"></image>
						</view>
						<view class="con_right">
							<view class="r_title">
								{{item.title}}
							</view>
							<!-- <view class="r_rate">
								{{scoreNum(e.r.rate)}}
							</view> -->
							<!-- :style="`color:${e.r.recipe_list_tags[0].text_color};background:${e.r.recipe_list_tags[0].background_end_color}`" -->
							<!-- 	<view class="r_little">
								{{e.r.recipe_list_tags[0].text}}
							</view> -->
							<view class="user_info">
								<image class="info_img" :src="`${item.author.p}`" mode=""></image>
								<view class="info_name">
									{{item.author.n}}
								</view>
							</view>
						</view>
					</block>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		name: "collectMenu",
		props: ["data"],
		data() {
			return {

			};
		},
		methods:{
			menuClick(k){
				console.log(k.id)
				// if(k.r){
				// 	console.log('菜谱详情',k.r.id);
					// uni.navigateTo({
					// 	url:`/pages/childPage/menuDetail/menuDetail?value=${k.id}`
					// })
				// }else{
				// 	console.log('笔记详情',k.note.id);
					uni.navigateTo({
						url:`/pages/childPage/noteDetail/noteDetail?id=${k.id}`
					})
				// }
				
			}
		}
	}
</script>

<style lang="scss">
	.menu_box {
		width: 100%;

		.title {
			width: 100%;
			text-align: center;
			line-height: 800rpx;
			height: 800rpx;
			color: #999;
		}
	}

	.container {
		width: 100%;
	}

	.menu_container {
		display: flex;
		width: 96%;
		margin: 80rpx auto;
		height: 240rpx;
		flex-wrap: wrap;
		justify-content: space-around;
		align-items: center;

		&:first-child {
			margin-top: 6rpx;
		}

		.con_left {
			width: 50%;

			.left_img {
				width: 100%;
				height: 280rpx;
				border-radius: 16rpx;
			}
		}

		.con_right {
			width: 40%;
			height: 100%;
			display: flex;
			flex-wrap: wrap;

			.r_title {
				width: 100%;
				font-size: 34rpx;
				font-weight: bold;
				display: -webkit-box;
				/**对象作为伸缩盒子模型展示**/
				-webkit-box-orient: vertical;
				/**设置或检索伸缩盒子对象的子元素的排列方式**/
				-webkit-line-clamp: 3;
				/**显示的行数**/
				overflow: hidden;
				/**隐藏超出的内容**/

			}

			.r_rate {
				color: #000000;
				font-weight: bold;
			}

			.r_little {
				// background-color: #007AFF;
				width: 50%;
				height: 40rpx;
				line-height: 40rpx;
				font-size: 28rpx;
				text-align: center;
				border-radius: 8rpx;
			}

			.user_info {
				display: flex;
				align-items: center;

				.info_img {
					width: 48rpx;
					height: 48rpx;
					border-radius: 50%;
					margin-right: 16rpx;
				}

				.info_name {
					color: #999998;
					font-size: 28rpx;
				}
			}
		}
	}
</style>
